package cn.itcast.travel.service.impl;

import cn.itcast.travel.dao.FavouriteDao;
import cn.itcast.travel.dao.impl.FavouriteDaoImpl;
import cn.itcast.travel.domain.Favorite;
import cn.itcast.travel.service.FavouriteService;

public class FavouriteServiceImpl implements FavouriteService {
    FavouriteDao favouriteDao = new FavouriteDaoImpl();
    @Override
    public boolean isFavourite(String rid, int uid) {
        Favorite favourite = favouriteDao.isFavourite(Integer.parseInt(rid), uid);
        System.out.println(favourite);
        return favourite !=null;
    }

    @Override
    public void addFavourite(String rid,int uid) {
        favouriteDao.addFavourite(Integer.parseInt(rid),uid);
    }

    @Override
    public void delFavourite(String rid, int uid) {
        favouriteDao.delFavourite(Integer.parseInt(rid),uid);
    }
}
